import React from './react';
import ReactDom from './react-dom';

/**
 * react dom元素render
 */
// let element = React.createElement('h1',{
//   className: 'title',
//   style: {
//     background: 'yellow'
//   }
// },'hello',React.createElement('span',null,'world'));
// console.log(element,'element');

//函数组件
// function Welcome(props){
//  return  React.createElement('h1',{
//     className: 'title',
//     style: {
//       background: 'yellow'
//     }
//   },'hello1',React.createElement('span',null,'world1'));
// };
// let element = <Welcome/>; 

class Welcome extends React.Component {
  render(){
    return  React.createElement('h1',{
      className: 'title',
      style: {
        background: 'yellow'
      }
    },'hello2',React.createElement('span',null,'world2'));
  }
}
let element = <Welcome/>;
console.log(element,'ele')
ReactDom.render(
  element,
  document.getElementById('root')
)
